package com.maxmlr.mybatisplus.common.base;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * 
 * @Package com.maxmlr.common.base
 * @ClassName BaseEntity
 * @Description 实体类 基类
 * @author max
 * @since 2018年12月15日 下午6:07:47 
 * @version 1.0
 * @Copyright Copyright (c) 2018: www.maxmlr.com.
 */
public class BaseEntity implements Serializable  {
	private static final long serialVersionUID = 1L;

	/** id */
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	protected Integer id;

	/** 开始日期 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@ApiModelProperty("开始时间")
	protected Date beginDate;

	/** 结束日期 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@ApiModelProperty("结束时间")
	protected Date endDate;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Override
	public String toString() {
		return "Base：" + JSON.toJSONString(this);
	}
}
